		// 获取宽度
function getWidth()
{
    var strWidth,clientWidth,bodyWidth;
    clientWidth = document.documentElement.clientWidth;
    bodyWidth = document.body.clientWidth;
    if(bodyWidth > clientWidth){
        strWidth = bodyWidth + 20;
    } else {
        strWidth = clientWidth;
    }
    return strWidth;
}
//获取高度
function getHeight()
{
    var strHeight,clientHeight,bodyHeight;
    clientHeight = document.documentElement.clientHeight;
    bodyHeight = document.body.clientHeight;
    if(bodyHeight > clientHeight){
        strHeight = bodyHeight + 30;
    } else {
        strHeight = clientHeight;
    }
    return strHeight+1000;
}
// 锁屏
function showScreen(div1,div2,clientWidth)
{
    var div1=div1;
   var div2=div2;
	var Msg = document.getElementById(div1);
    var Bg = document.getElementById(div2);
    Bg.style.width = getWidth()+'px';
    Bg.style.height = getHeight()+'px';
    document.getElementById(div1).style.left=clientWidth+"px"; //document.body.clientWidth / 2 表示居中
    document.getElementById(div1).style.top=screen.height/2-300+"px";
    Msg.style.display = 'block';
    Bg.style.display = 'block';
}
//解屏
function hideScreen(div1,div2)
{
   var div1=div1;
   var div2=div2;
   var Msg = document.getElementById(div1);
    var Bg = document.getElementById(div2);
    Msg.style.display = 'none';
    Bg.style.display = 'none';
}
/*dfdfads
使用方法  
此功能一共需要使用三个文件 1本js文件 2 lockscreen.css文件 3所以html调用的页面
调用：
showScreen(div1,div2)  div1和div2是两个层的div名   注意css文件里的样式名要和div的名称对应
例如：
 <div id="Message" style="border:#00BFFF solid 1px; background:#FFFFFF; width:400px; height:100px"><span style="cursor:pointer;" onclick="javascript:hideScreen('Message','Screen',距屏幕左边的像素);">关闭</span>
 <div id="Screen"></div>
<p><span style="cursor:pointer;" onclick="javascript:showScreen('Message','Screen');">锁屏</span></p> 

dsdsd*/